Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gmp] Fix building for linux x86 #31339

Merged
merged 1 commit into from
May 9, 2023
Merged

[gmp] Fix building for linux x86 #31339

merged 1 commit into from
May 9, 2023

Conversation

robbert-ef
Copy link
Contributor

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@robbert-ef
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Easyflex"

@Cheney-W Cheney-W added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label May 9, 2023
Comment on lines +68 to +71
elseif(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(ccas "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
vcpkg_list(APPEND OPTIONS "ABI=32")
string(APPEND asmflags " -m32")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have recently seen/used the same x86 pattern in another port but for Android.

  • Do we really need ABI=32 in addition to -m32?
  • Which other x86 toolchains/triplets will understand -m32?
  • Can we get -m32 from the cmake toolchain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ABI=32 is required, fixes:

configure: error: Oops, mp_limb_t is 32 bits, but the assembler code
in this configuration expects 64 bits.
You appear to have set $CFLAGS, perhaps you also need to tell GMP the
intended ABI, see "ABI and ISA" in the manual.

The -m32 is also necessary, without it, compile of asm fails:

tmp-add_n.s: Assembler messages:
tmp-add_n.s:202: Error: operand type mismatch for `jmp'
make[2]: *** [add_n.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
tmp-sub_n.s: Assembler messages:
tmp-sub_n.s:202: Error: operand type mismatch for `jmp'
make[2]: *** [sub_n.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need asm flags you might want to actually request it from vcpkg_get_cmake_vars.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, vcpkg_cmake_get_vars isn't taking parameters such as LANGUAGES ATM. (And maybe it should be handled gracefully if ASM can't be enabled.)

@Cheney-W Cheney-W added the info:reviewed Pull Request changes follow basic guidelines label May 9, 2023
@vicroms vicroms merged commit 76fb3e5 into microsoft:master May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants